home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
090
/
byteibm.arc
/
CLAFF.ARC
/
LISTING1.DOC
next >
Wrap
Text File
|
1985-07-12
|
2KB
|
71 lines
;=======INTERRUPT VECTOR STRUCTURE
VECTOR STRUC
REGIP DW ?
REGCS DW ?
VECTOR ENDS
;=======KEYBOARD SHIFT FLAG RECORD
KBFLAGS RECORD INS:1,CAPS:1,NUM:1,SCROLL:1,
ALT:1,CTL:1,LEFT:1,RIGHT:1
;=======CODE SEGMENT
CODE SEGMENT
;*******EXECUTION STARTS WITH THIS PIECE
ASSUME CS:CODE,DS:CODE,ES:CODE,SS:CODE
; PROGRAM SEGMENT PREFIX
INCLUDE PSP.INC
; LABEL FOR END STATEMENT
IP LABEL NEAR
JMP SHORT START
;*******INTERRUPT INTERCEPT PIECE
ASSUME CS:CODE,DS:NOTHING,ES:NOTHING
ASSUME SS:NOTHING
ORG05 VECTOR <> ;ORIGINAL INT
; 005H VECTOR
;-------INTERCEPT ROUTINE
INT05 PROC FAR
PUSH AX
MOV AH,002H ;GET KEYBOARD
; FLAGS FROM BIOS
INT 016H
; TEST FOR RIGHT SHIFT KEY
TEST AL,MASK RIGHT
POP AX
JNZ INT05X
; NOT DOWN, DO ORIGINAL INT 005H
JMP ORG05
INT05X LABEL NEAR
IRET
INT05 ENDP
;*******INITIALIZATION PIECE
ASSUME CS:CODE,DS:CODE,ES:CODE,SS:CODE
START LABEL NEAR
;-------GET INT 5 VECTOR AND SAVE IN ORG05
PUSH ES
MOV AH,035H
MOV AL,005H
INT 021H
ASSUME ES:NOTHING
MOV ORG05.REGIP,BX
MOV ORG05.REGCS,ES
POP ES
ASSUME ES:CODE
;-------SET INT 5 VECTOR TO INT05
MOV AH,025H
MOV AL,005H
MOV DX,OFFSET INT05
INT 021H
;-------FREE MEMORY ALLOCATED TO THE ENVIRONMENT
PUSH ES
MOV AH,049H
MOV ES,ENVIRONMENT
ASSUME ES:NOTHING
INT 021H
POP ES
ASSUME ES:CODE
;-------TERMINATE PROTECTING MEMORY BELOW START
MOV DX,OFFSET START
INT 027H
CODE ENDS
END IP ;NOTE IP FOR EXE2BIN